<?php

/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/

//Route::get('/', function () {
//    return view('welcome');
//});
Route::get('/cars', 'CarController@index');
Route::get('/show', 'StudentController@test');
Route::get('/articles', 'ArticleController@index');

Route::get('/products', 'ProductController@index');
Route::get('/product/{id}', 'ProductController@getProduct');
Route::get('/shops', 'ShopController@index');
Route::get('/shop/add', 'ShopController@add');
Route::get('/test', 'ShopController@test');
Route::get('/lang', 'ShopController@lang');
Route::get('/plk', 'ShopController@plk');
Route::get('/box', 'ShopController@box');
Route::get('/scope', 'ShopController@showSco');
Route::get('/many', 'ShopController@searchMany');
Route::get('/au', 'ShopController@au');
Route::get('/mail', 'ShopController@sendMail');

Route::group(
    [
        'prefix' => 'student'
    ],
    function($router) {
        Route::get('login', 'StudentController@loginForm');
        Route::post('login', 'StudentController@login')->name('student_login');
        Route::post('register', 'StudentController@register')->name('student_register');
        Route::get('register', 'StudentController@loadRegister');
        Route::get('logout', 'StudentController@logout');
        Route::get('home', 'StudentController@index')->name('student_home');
    
    }
);

//App::bind(
//    'Person', function() {
//        echo 'this is a person show';
//        return new \App\Person([7,8,9,10]);
//}
//);
Route::get('service', 'PersonController@show');
Route::get('shopservice', 'ShopController@service');

Route::get('first', 'ShopController@getFirst');

Route::get('workerservice', 'ShopController@worker');
Route::get('worker', 'WorkerController@index');
//Auth::routes();

Route::get('/home', 'HomeController@index')->name('home');
